/**
 * @file
 * @description 公共主件注册文件
 */

import {
    Button, Table, Tree, Form, FormItem, Input, Menu, MenuItem, Submenu, MenuItemGroup
    , Result, Breadcrumb, BreadcrumbItem, Message, MessageBox, Switch, TableColumn,
    Pagination, Dialog, Select, Option, Loading
} from "element-ui"
import { confirm } from 'uti/common'
import { myConfirm } from 'com/MyConfirm/index.js'
import MyDialog from 'com/Dialog'
import MyTable from 'com/Table'

export default {
    install(Vue) {
        Vue.prototype.$myConfirm = myConfirm;
        Vue.prototype.$mb = MessageBox;
        Vue.prototype.$m = Message;
        Vue.prototype.$confirm = confirm;
        [MyDialog, MyTable].forEach(item => Vue.component(item.name, item));
        [Button, Table, Tree, Form, FormItem, Input, Menu, MenuItem, Submenu, MenuItemGroup
            , Result, Breadcrumb, BreadcrumbItem, Switch, TableColumn,
            Pagination, Dialog, Select, Option, Loading].forEach(item => Vue.use(item));
    }
}